﻿<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<title> js实现的文本框内容发生改变立马触发事件简单介绍</title>
<script type="text/javascript">
window.onload=function(){
  var otxt=document.getElementById("txt");
  var oshow=document.getElementById("show");
  var count=0;
  if(document.all){
     otxt.onpropertychange=function(){
       count=count+1;
       oshow.innerHTML=count;
       console.log("prop");
     }
  }
  else{
    otxt.oninput=function(){
      count=count+1;
      oshow.innerHTML=count;
      console.log("ince");
    }
  }
  
  function ascend(a,b)
	{
		return a - b;
	}
	
	var test = [12, 929, 11, 3, 199, 1000, 7, 1, 24, 37,
	 4,19, 300, 3775, 299, 36, 209, 148, 169, 299, 6, 109, 
	 m20, 58, 139, 59, 3, 1, 139];
  
  var fuckyou = [2,1,10,7,6];
  fuckyou = test;
  console.log(fuckyou);
  console.log(fuckyou.sort(ascend));
  console.log(fuckyou);
  
  var arr = new Array(6)
arr[0] = "George"
arr[1] = "John"
arr[2] = "thomas"
arr[3] = "james"
arr[4] = "Adrew"
arr[5] = "Martin"

console.log(arr);
console.log(arr.sort());
}
</script>
</head>
<body>
<div id="show"></div>
<input type="text" id="txt" value="zkl"/>
</body>
</html>